package com.it.day3;

import java.util.ArrayList;
import java.util.Random;

/**
 * ClassName: OOMTest
 * Description: OOM测试
 *
 * @Author: csx
 * @Create: 2025/4/27 - 11:04
 * @version: v1.0
 */
public class OOMTest {
    public static void main(String[] args) {
        ArrayList<Picture> list = new ArrayList<>();
        while(true){
//            try {
//                Thread.sleep(20);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            list.add(new Picture(new Random().nextInt(1024 * 1024)));
        }
    }
}

class Picture {
    private byte[] pixels;

    public Picture(int length) {
        this.pixels = new byte[length];
    }
}
